<template>
    <div id="app">
      <el-form ref="add-member" :model="member" label-width="100px">
        <el-form-item label="姓名">
          <el-input v-model="member.name" placeholder="请输入姓名"></el-input>
        </el-form-item>

        <el-form-item label="密码">
          <el-input v-model="member.pwd"></el-input>
        </el-form-item>

        <el-form-item label="充值">
          <el-input v-model="member.money"></el-input>
        </el-form-item>

        <el-form-item label="电话">
          <el-input v-model="member.tel"></el-input>
        </el-form-item>

        <el-form-item label="性别">
          <el-radio-group v-model="member.gender">
            <el-radio label="男">男</el-radio>
            <el-radio label="女">女</el-radio>
          </el-radio-group>
        </el-form-item>

        <el-form-item label="身份证号">
          <el-input v-model="member.cardId"></el-input>
        </el-form-item>

        <el-form-item label="描述">
          <el-input v-model="member.description"  type="textarea" rows="5"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="save()">提交</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
    export default {
      data(){
        return {
          member:{}
        }
      },
      methods:{
        save(){
          //发出ajax请求
          this.axios.post("/member/add",this.member).then((resp)=>{
            this.$message.success("添加类别成功！");
            this.$router.push("/member/MemberList");
          })
        }
      }
    }
</script>


<style scoped>

</style>
